import { Boolean, Code, CreateDate, DateTime, Desc, Digdit, Entity, Jsonb, PrimaryUuid, Title, UpdateDate } from "@sker/core";

@Entity({
    name: 'sys_task'
})
export class SysTask {
    @PrimaryUuid({
        primaryKeyConstraintName: "PK_SYS_TASK_ID"
    })
    id: string;

    @Title()
    title: string;

    @Desc({ nullable: true, default: '' })
    desc: string;

    @Code({ length: 50, default: '', nullable: true })
    type: string;

    @Code()
    rule: string;

    @Code()
    task: string;

    @Boolean({ default: false })
    status: boolean;

    @Boolean({ default: false })
    runing: boolean;

    @Digdit({ default: 0, comment: '执行次数' })
    count: number;

    @DateTime({ nullable: true })
    end_time: Date;

    @Jsonb({ nullable: true })
    body: any;

    @CreateDate()
    create_date: Date;

    @UpdateDate()
    update_date: Date;
}